<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>12.扩展运算符实践</title>
</head>
<body>
<div></div>
<div></div>
<div></div>

<script>
  let arr1 = [1,2]
  let arr2 = [3,4]

  //数组的复制和拼接
  let arr3 = arr1 // 1,2
  let arr4 = [...arr1]// 1,2

  let arr5 = arr1.concat(arr2) //[1,2,3,4]
  let arr6 = [...arr1,...arr2]//[1,2,3,4]

  console.log(arr3)
  console.log(arr4)
  console.log(arr5)
  console.log(arr6)

  //将伪数组变成数组
  let divs = document.getElementsByTagName('div')
  console.log(divs)
  let divs2 = [...divs]
  console.log(divs2)


</script>

</body>
</html>